<template>
    <div class="child">
        <p> 子自己:{{ toy }}</p>
        <p>子： {{ car }}</p>
        <button @click="sendToy(toy)">子按钮</button>
        <button @click="emit('haha',2000)">子按钮2</button>
        <button @click="emit('send-toy',2000)">子按钮3</button>
       
    </div>
</template>


<script setup lang="ts" name="Page45">
import { onMounted, ref } from 'vue';
let toy = ref('奥特曼')
defineProps(['car', 'sendToy'])
const emit = defineEmits(['haha','send-toy'])
onMounted(() => {
    setTimeout(() => {
        emit('haha',1000)
    }, 3000)
})
</script>


<style scoped>
.count {
    background-color: orange;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
}

select,
button {
    margin: 0 5px;
    height: 40ppx;
    line-height: 18px;
}
</style>